//
// Created on 2025/7/31.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef MYAPPLICATION_INDEX_H
#define MYAPPLICATION_INDEX_H

#include "napi/native_api.h" // 这个头文件必须放在第一个引用，不然会报错，不知道为什么
#include "utils.h"
#include <ace/xcomponent/native_interface_xcomponent.h>
#include <string>
#include <tuple>

struct Interface{
    static void InitEditor();
    static void DestroyEditor();
    static void SetVideo(std::string& path, int32_t fd);
    static void SetBgAudio(std::string& path, int32_t fd);
    static void UnsetBgAudio();
    static std::tuple<std::string, int32_t, int32_t> AddImage(std::string& path);
    static void RemoveImage(std::string& imageId);
    static void SetTrim(uint64_t trimIn, uint64_t trimOut);
    static void MoveImage(std::string imageId, float positionX, float positionY);
    static void ScaleImage(std::string imageId, float scale);
    static void RotateImage(std::string imageId, float rotate);
    static uint64_t GetDuration();
    static uint64_t GetOriginalDuration();
    static napi_value _Init(napi_env env, napi_value exports);
    static VEditorStatus Export();
    static VEditorStatus Play();
    static VEditorStatus Pause();
    static VEditorStatus Stop();
    static VEditorStatus PlayFromStart();
    static void MuteVideo(bool muted);
    static void SetCanvasSize(int32_t height, int32_t width);
    static std::vector<std::pair<uint32_t, uint32_t>> GetDrawableArea();
};

static void onCreated(OH_NativeXComponent* component, void* window);
static OH_NativeXComponent_Callback callback;
#endif //MYAPPLICATION_INDEX_H
